<template>
	<view>
		<view class="coin">
			<view class="coin-q" v-for="(item,index) in inforList" :key="index" >
				<image src="http://image.zjyph.cn/file/pic/20220825203241358221.png" mode=""></image>
				<view class="coin-w">
					<view class="coin-e">兑换券</view>
					<view class="coin-r">
						<view class="coin-t">
							<view class="coin-y">可兑换商品：</view>
							<view class="coin-u">
								<text>{{item.couponTitle}}</text>
							</view>
							<view class="coin-i"><text>{{item.createTime}}-{{item.endTime}}</text></view>
						</view>
						<view class="coin-o" v-if="item._msg == '可使用'" @click="goOrder(item)">
							<image src="../../static/img/liji.png" mode=""></image>
						</view>
						<view class="coin-o" v-if="item._msg == '已过期'">
							<image src="../../static/img/liji2.png" mode=""></image>
						</view>
						<view class="coin-o" v-if="item._msg == '已使用'">
							<image src="../../static/img/liji1.png" mode=""></image>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { getcoinCidence } from '@/api/activity';
export default {
	data() {
		return {
			inforList:[]
		};
	},
	mounted() {
		this.gettesefun()
	},
	methods: {
		gettesefun() {
			getcoinCidence().then(res => {
				if (res.status == 200) {
					this.inforList = res.data;
				}
			});
		},
		goOrder(item){
			uni.setStorageSync('item',item)
			this.$yrouter.push({ path: '/pages/order/exchangeOrder/exchangeOrder', query: { item: item.id } })
		}
	}
};
</script>

<style lang="less" scoped>
.coin {
	width: 94%;
	margin: 24rpx auto;
	.coin-q {
		height: 251rpx;
		margin-bottom: 24rpx;
		image {
			width: 100%;
			height: 100%;
		}
		.coin-w {
			position: relative;
			height: 251rpx;
			top: -256rpx;
			.coin-e {
				font-size: 52rpx;
				font-family: Source Han Sans CN;
				font-weight: 500;
				color: #ffffff;
				line-height: 32rpx;
				margin-top: 30rpx;
				margin-left: 34rpx;
			}
			.coin-r {
				display: flex;
				margin-top: 24rpx;
				.coin-t {
					width: 65%;
					.coin-y {
						font-size: 24rpx;
						font-family: FZHei-B01S;
						font-weight: 400;
						color: #ffffff;
						line-height: 36rpx;
						margin-left: 35rpx;
					}
					.coin-u {
						font-size: 24rpx;
						font-family: FZHei-B01S;
						font-weight: 400;
						color: #ffffff;
						line-height: 16rpx;
						margin-left: 35rpx;
						margin-top: 6rpx;
						text {
							margin-right: 15rpx;
						}
					}
					.coin-i {
						width: 311rpx;
						height: 36rpx;
						margin-top: 42rpx;
						margin-left: 36rpx;
						background: #fdc090;
						font-size: 24rpx;
						font-family: FZHei-B01S;
						font-weight: 400;
						color: #ff7011;
						line-height: 36rpx;
						text {
							margin-left: 6rpx;
						}
					}
				}
				.coin-o{
					width: 152rpx;
					height: 57rpx;
					margin-left: 42rpx;
					margin-top: 20rpx;
					image{
						width: 100%;
						height: 100%;
					}
				}
			}
		}
	}
}
</style>
